/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.group4.highschoolportal.parent.backingBean;

import com.group4.controller.ParentFacade;
import com.group4.controller.StudentFacade;
import com.group4.entity.Parent;
import com.group4.entity.Student;
import com.group4.highschoolportal.loginBean.IndexBackingBean;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Victor Cernea
 */
@ManagedBean
@RequestScoped
public class ParentHomeControllerBean implements Serializable {
    @ManagedProperty(value = "#{indexBackingBean}")
    private IndexBackingBean ib;
    
    private Parent parent;
    
    @ManagedProperty(value = "#{parentBackingBean}")
    private ParentBackingBean pb;
    
    @EJB
    ParentFacade pdb;

    /** Creates a new instance of StudentHomeControllerBean */
    public ParentHomeControllerBean() {
        System.out.print(pdb.findByLogin(ib.getUsername(), ib.getPassword()).toString());
        pb.setParent(pdb.findByLogin(ib.getUsername(), ib.getPassword()));
    }

    public Parent getParent() {
        return parent;
    }

    public void setParent(Parent parent) {
        this.parent = parent;
    }

    public IndexBackingBean getIb() {
        return ib;
    }

    public void setIb(IndexBackingBean ib) {
        this.ib = ib;
    }

    public ParentFacade getPdb() {
        return pdb;
    }

    public void setPdb(ParentFacade pdb) {
        this.pdb = pdb;
    }
    
    
    
}
